using System;
using System.Collections.Generic;
using System.Text;


namespace Microsoft.ConnectionEngine.Common.Security
{
    /// <summary>
    /// ASPNET MEMBERSHIP USER CLASS
    /// Issues Solved 40,41,42,43,44,45,46,47,48,49,50
    /// Comments have been added and All the member properties which were hiding the inherited members
    /// shadowed usign "new" keyword.
    /// Dated:24-Apr-2007    By:sajoshi
    /// </summary>
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://Microsoft.ConnectionEngine/Schemas/ServiceProviderRegister")]
    public class AspnetMembershipUser: System.Web.Security.MembershipUser
    {
        #region Member variables

        private Guid applicationID = Guid.Empty;
        private Guid userID = Guid.Empty;
        private string userName = string.Empty;
        private string loweredUserName = string.Empty;
        private string mobileAlias = string.Empty;
        private bool isAnonymous;
        private string password = string.Empty;
        private int passwordFormat = int.MinValue;
        private string passwordSalt = string.Empty;
        private string mobilePIN = string.Empty;
        private string email = string.Empty;
        private string loweredEmail = string.Empty;
        private string passwordQuestion = string.Empty;
        private string passwordAnswer = string.Empty;
        private bool isApproved;
        private bool isLockedOut;
        private int failedPasswordAttemptCount = int.MinValue;
        private int failedPasswordAnswerAttemptCount = int.MinValue;
        private string comment = string.Empty;
        private string hcuId = string.Empty;
        private string providerId = string.Empty;
        
        private DateTime createDate = new DateTime(1753, 1, 1);                             // Minimum SQLServer date
        private DateTime lastLoginDate = new DateTime(1753, 1, 1);                          // Minimum SQLServer date
        private DateTime lastPasswordChangedDate = new DateTime(1753, 1, 1);                // Minimum SQLServer date
        private DateTime lastLockoutDate = new DateTime(1753, 1, 1);                        // Minimum SQLServer date
        private DateTime lastActivityDate = new DateTime(1753, 1, 1);                       // Minimum SQLServer date
        private DateTime failedPasswordAttemptWindowStart = new DateTime(1753, 1, 1);       // Minimum SQLServer date
        private DateTime failedPasswordAnswerAttemptWindowStart = new DateTime(1753, 1, 1); // Minimum SQLServer date

        #endregion

        #region Constructors

        /// <summary>
        /// Default constructor
        /// </summary>
        public AspnetMembershipUser()
        { }

        /// <summary>
        /// Constructs the object and sets the the member varibles
        /// </summary>
        public AspnetMembershipUser(Guid applicationID, Guid userID, string userName, string loweredUserName, string mobileAlias,
            bool isAnonymous, DateTime lastActivityDate, string hcuId, string providerId, 
            string password, int passwordFormat, string passwordSalt, string mobilePIN, string email, string loweredEmail, string passwordQuestion, string passwordAnswer, bool isApproved, bool isLockedOut, DateTime createDate, DateTime lastLoginDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate, int failedPasswordAttemptCount, DateTime failedPasswordAttemptWindowStart, int failedPasswordAnswerAttemptCount, DateTime failedPasswordAnswerAttemptWindowStart, string comment)
        {
            this.applicationID = applicationID;
            this.userID = userID;
            this.userName = userName;
            this.loweredUserName = loweredUserName;
            this.mobileAlias = mobileAlias;
            this.isAnonymous = isAnonymous;
            this.lastActivityDate = lastActivityDate;
            this.hcuId = hcuId;
            this.providerId = providerId;

            this.password = password;
            this.passwordFormat = passwordFormat;
            this.passwordSalt = passwordSalt;
            this.mobilePIN = mobilePIN;
            this.email = email;
            this.loweredEmail = loweredEmail;
            this.passwordQuestion = passwordQuestion;
            this.passwordAnswer = passwordAnswer;
            this.isApproved = isApproved;
            this.isLockedOut = isLockedOut;
            this.createDate = createDate;
            this.lastLoginDate = lastLoginDate;
            this.lastPasswordChangedDate = lastPasswordChangedDate;
            this.lastLockoutDate = lastLockoutDate;
            this.failedPasswordAttemptCount = failedPasswordAttemptCount;
            this.failedPasswordAttemptWindowStart = failedPasswordAttemptWindowStart;
            this.failedPasswordAnswerAttemptCount = failedPasswordAnswerAttemptCount;
            this.failedPasswordAnswerAttemptWindowStart = failedPasswordAnswerAttemptWindowStart;
            this.comment = comment;
        }

        /// <summary>
        /// Constructs the object from User details sets the the member varibles
        /// </summary>
        public AspnetMembershipUser(Guid applicationID, Guid userID, string userName, string loweredUserName, string mobileAlias, 
            bool isAnonymous, DateTime lastActivityDate, string hcuId, string providerId)
        {
            this.applicationID = applicationID;
            this.userID = userID;
            this.userName = userName;
            this.loweredUserName = loweredUserName;
            this.mobileAlias = mobileAlias;
            this.isAnonymous = isAnonymous;
            this.lastActivityDate = lastActivityDate;
            this.hcuId = hcuId;
            this.providerId = providerId;
        }

        #endregion

        #region Properties
        /// <summary>
        /// Application ID
        /// </summary>
        public Guid ApplicationID
        {
            get { return applicationID; }
            set { applicationID = value; }
        }
        /// <summary>
        /// User ID
        /// </summary>
        public Guid UserID
        {
            get { return userID; }
            set { userID = value; }
        }
        /// <summary>
        /// User Name
        /// </summary>
        public new String UserName
        {
            get { return userName; }
            set { userName = value; }
        }
        /// <summary>
        /// LoweredUserName
        /// </summary>
        public string LoweredUserName
        {
            get { return loweredUserName; }
            set { loweredUserName = value; }
        }
        /// <summary>
        /// Mobile Alias
        /// </summary>
        public string MobileAlias
        {
            get { return mobileAlias; }
            set { mobileAlias = value; }
        }
        /// <summary>
        /// IsAnonymous
        /// </summary>
        public bool IsAnonymous
        {
            get { return isAnonymous; }
            set { isAnonymous = value; }
        }
        /// <summary>
        /// Last Activity Date
        /// </summary>
        public new DateTime LastActivityDate
        {
            get { return lastActivityDate; }
            set { lastActivityDate = value; }
        }
        /// <summary>
        /// HCU ID
        /// </summary>
        public string HCUID
        {
            get { return hcuId; }
            set { hcuId = value; }
        }
        /// <summary>
        /// Provider ID
        /// </summary>
        public string ProviderId
        {
            get { return providerId; }
            set { providerId = value; }
        }
        /// <summary>
        /// Password
        /// </summary>
        public string Password
        {
            get { return password; }
            set { password = value; }
        }
        /// <summary>
        /// Password Format
        /// </summary>
        public int PasswordFormat
        {
            get { return passwordFormat; }
            set { passwordFormat = value; }
        }
        /// <summary>
        /// Password Salt
        /// </summary>
        public string PasswordSalt
        {
            get { return passwordSalt; }
            set { passwordSalt = value; }
        }
        /// <summary>
        /// Mobile PIN
        /// </summary>
        public string MobilePIN
        {
            get { return mobilePIN; }
            set { mobilePIN = value; }
        }
        /// <summary>
        /// Email
        /// </summary>
        public new string Email
        {
            get { return email; }
            set { email = value; }
        }
        /// <summary>
        /// LoweredEmail
        /// </summary>
        public string LoweredEmail
        {
            get { return loweredEmail; }
            set { loweredEmail = value; }
        }
        /// <summary>
        /// Password Question
        /// </summary>
        public new string PasswordQuestion
        {
            get { return passwordQuestion; }
            set { passwordQuestion = value; }
        }
        /// <summary>
        /// Password Answer
        /// </summary>
        public string PasswordAnswer
        {
            get { return passwordAnswer; }
            set { passwordAnswer = value; }
        }
        /// <summary>
        /// Is Approved
        /// </summary>
        public new bool IsApproved
        {
            get { return isApproved; }
            set { isApproved = value; }
        }
        /// <summary>
        /// Is Locked Out
        /// </summary>
        public new bool IsLockedOut
        {
            get { return isLockedOut; }
            set { isLockedOut = value; }
        }
        /// <summary>
        /// Creation Date
        /// </summary>
        public DateTime CreateDate
        {
            get { return createDate; }
            set { createDate = value; }
        }
        /// <summary>
        /// Last Login Date
        /// </summary>
    public new DateTime LastLoginDate
        {
            get { return lastLoginDate; }
            set { lastLoginDate = value; }
        }
        /// <summary>
        /// Last PAssword Change Date
        /// </summary>
        public new DateTime LastPasswordChangedDate
        {
            get { return lastPasswordChangedDate; }
            set { lastPasswordChangedDate = value; }
        }
        /// <summary>
        /// Last Lockout Date
        /// </summary>
        public new DateTime LastLockoutDate
        {
            get { return lastLockoutDate; }
            set { lastLockoutDate = value; }
        }

        /// <summary>
        /// Failed Password Attempt Count
        /// </summary>
        public int FailedPasswordAttemptCount
        {
            get { return failedPasswordAttemptCount; }
            set { failedPasswordAttemptCount = value; }
        }
        /// <summary>
        /// Failed Password attempt Window Start
        /// </summary>
        public DateTime FailedPasswordAttemptWindowStart
        {
            get { return failedPasswordAttemptWindowStart; }
            set { failedPasswordAttemptWindowStart = value; }
        }
        /// <summary>
        /// Failed password Answer Attempt Count
        /// </summary>
        public int FailedPasswordAnswerAttemptCount
        {
            get { return failedPasswordAnswerAttemptCount; }
            set { failedPasswordAnswerAttemptCount = value; }
        }
        /// <summary>
        /// Failed Password Answer Attempt Window Start
        /// </summary>
        public DateTime FailedPasswordAnswerAttemptWindowStart
        {
            get { return failedPasswordAnswerAttemptWindowStart; }
            set { failedPasswordAnswerAttemptWindowStart = value; }
        }
        /// <summary>
        /// Comments
        /// </summary>
        public new string Comment
        {
            get { return comment; }
            set { comment = value; }
        }

        #endregion
    }
}
